<template>
  <!-- 新建抽检任务对话框 -->
  <el-dialog :title="title" :visible.sync="visible" width="500px" append-to-body>
    <el-form ref="form" :model="model" :rules="rules" label-width="120px">
      <el-form-item label="抽检名称" prop="taskName">
        <el-input v-model="model.taskName" placeholder="请输入抽检任务名称" />
      </el-form-item>
      <el-form-item label="记录占比（%）" prop="percent">
        <el-input v-model="model.percent" placeholder="请输入抽检记录占总数的百分比" />
      </el-form-item>
      <el-form-item label="开始位置" prop="startNum">
        <el-input v-model="model.startNum" placeholder="请输入抽检的开始位置" />
      </el-form-item>
    </el-form>
    <div slot="footer" class="dialog-footer">
      <el-button type="primary" @click="handleSubmit">确 定</el-button>
      <el-button @click="handleCancle">取 消</el-button>
    </div>
  </el-dialog>
</template>

<script>
import {
  listQaTask,
  listQaTaskChecker,
  listQaTaskQa,
  getQaTask,
  getTaskWithParent,
  updateQaTaskStatus,
  delQaTask,
  addQaTask,
  updateQaTask,
  summarize,
  batchSummarize,
  taskAutoCheck,
} from '@/api/mark/qaTaskV1'
export default {
  name: 'TaskManuCheckDialog',
  data() {
    return {
      title: '新建抽检任务',
      visible: false,

      model: {
        taskId: undefined,
        duplicateTrackId: false,
        emptyCube: undefined,
        cutCheck: false,
        sheldCheck: false,
      },

      rules: {},
    }
  },
  methods: {
    open() {
      this.visible = true
    },
    handleSubmit() {
      this.subForm.taskType = this.subForm.startNum + ':' + this.subForm.percent
      addQaTask(this.subForm).then((response) => {
        if (response.code === 200) {
          this.msgSuccess('抽检任务创建成功')
          this.visible = false
          this.getList()
        } else {
          this.msgError(response.msg)
        }
      })
    },
    handleCancle() {
      this.visible = false
    },
  },
}
</script>

<style></style>
